import {TimeType} from '@/types/user' ;

export interface RequiredNacosInfo {
  ServiceId: string
  ServiceName: string
  Ip: string
  Port: number | string
  MetaData: string[]
  Status: string
}

interface RequiredServerInfo {
  EnvironmentName: string
  OSArchitecture: string
  ContentRootPath: string
  WebRootPath: string
  FrameworkDescription: string
  MemoryFootprint: string
  WorkingTime: string
}

export interface RequiredTriggers {
  jobId: string
  jobName: string
  jobGroup: string
  triggerId: string
  triggerName: string
  triggerGroup: string
  triggerStatus: string
}


interface RequiredTaskJob {
  Name: string
  JobGroup: string
  Cron: string
  AssemblyName: string
  ClassName: string
  RunTimes: number
  BeginTime: TimeType
  EndTime: TimeType
  TriggerType: number
  IntervalSecond: number
  CycleRunTimes: number
  IsStart: true
  JobParams: string
  Triggers: Triggers[]
  Id: number
  ModifyTime: TimeType
  CreateTime: TimeType
  CreateId: number
  ModifyId: number
  IsDeleted: true
  Remark: string
}


export interface TaskNameSpace {
  nameSpace?: string
  nameClass?: string
  remark?: string
}


interface DateCount {
  date: TimeType
  count: number
}

export interface RequestApiInfo {
  columns?: string[]
  rows?: string | string[] | DateCount[]
}

export interface MonitorInfo {
  Datetime?: TimeType
  Content?: string,
  IP?: string,
  LogColor?: string,
  Import?: number
}


/**
 * 任务
 */
export type TaskJob = Partial<RequiredTaskJob>


/**
 * NacosInfo
 */
export type NacosInfo = Readonly<Partial<RequiredNacosInfo>>

/**
 * 触发
 */
export type Triggers = Partial<RequiredTriggers>


/**
 * 获取服务信息
 */
export type Server = Readonly<Partial<RequiredServerInfo>>
